# -*- coding:utf-8 -*-
# @Time: 2020/9/3 13:34
# @Author: liupengfei
# @File: tasks.py

from celery import shared_task
from .models import Coupon


@shared_task()
def start_issue_coupon(coupon_id):
    # 开始发放优惠卷
    Coupon.objects.filter(id=coupon_id).update(status=Coupon.START_ISSUE)


@shared_task()
def end_issue_coupon(coupon_id):
    # 开始发放优惠卷
    Coupon.objects.filter(id=coupon_id).update(status=Coupon.END_ISSUE)
